import java.util.Arrays;
import java.util.function.BiFunction;
import java.util.function.UnaryOperator;

public class Task {

    public static void main(String[] args) {

        String[] words = args.clone();
        if (words.length == 0) {
            words = new String[]{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"};
        }
        
        // 把所有字母都转换成大写
        handleList(words, new UnaryOperator<String>() {
            @Override
            public String apply(String s) {
                return null;
            }
        });
        System.out.println(Arrays.toString(words));

        // 把每个条目根据其索引位置进行重复
        handleList2(words, new BiFunction<String, Integer, String>() {
            @Override
            public String apply(String s, Integer count) {
                return null;
            }
        });
        System.out.println(Arrays.toString(words));
    }

    public static void handleList(String[] list, UnaryOperator<String> operator) {
        for (int i = 0; i < list.length; i++) {
            list[i] = operator.apply(list[i]);
        }
    }
    public static void handleList2(String[] list, BiFunction<String, Integer, String> operator) {
        for (int i = 0; i < list.length; i++) {
            list[i] = operator.apply(list[i], i);
        }
    }

}